<template>
  <el-select v-bind="$attrs" v-on="$listeners" @change="change" clearable filterable>
    <el-option v-for="dict in $attrs.dict" :label="dict.label" :value="Number(dict.value)"/>
  </el-select>
</template>

<script>
export default {
  methods: {
    change(value) {
      const selectedOption = this.$attrs.dict.filter(dict => value == dict.value)[0]
      this.$emit('select', selectedOption)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>